<template>
      <div id="pay_success" class="app">
            <div class="divHead">
                <div class="divTitle">
                    <i class="el-icon-arrow-left" @click="goBack"></i>
                    校园送
                    <img src="../assets/images/home.png" @click="toMainPage"/>
                </div>
            </div>
            <div class="divContent">
                <img src="../assets/images/success.png"/>
                <div class="divSuccess">下单成功</div>
                <div class="divDesc">预计{{finishTime}}到达</div>
                <div class="divDesc1">后厨正在加紧制作中，请耐心等待~</div>
                <div class="btnView" @click="toOrderPage">查看订单</div>
            </div>
        </div>
</template>

<script>
import router from '@/router'
import { base } from '@/assets/js/base'
export default {
   
    name:"pay_success",
    data(){
        return {
            finishTime:''
        }
    },
    computed:{},
    created(){
        this.getFinishTime()
        base(document,window)
    },
    mounted(){},
    methods:{
        goBack(){
            window.requestAnimationFrame(()=>{
                router.push('/home')
            })   
        },
        toOrderPage(){
            window.requestAnimationFrame(()=>{
                router.push('/order')
            })  
        },
        toMainPage(){
            window.requestAnimationFrame(()=>{
                router.push('/home')
            })  
        },
        //获取送达时间
        getFinishTime(){
            let now = new Date()
            let hour = now.getHours() +1
            let minute = now.getMinutes()
            if(hour.toString().length <2){
                hour = '0' + hour
            }
            if(minute.toString().length <2){
                minute = '0' + minute
            }
            this.finishTime = hour + ':' + minute
        },
    }
}
</script>

<style>
@import url(../assets/styles/pay-success.css);
@import url(../assets/styles/index.css);
</style>